package com.punai.customer.mapper;

import com.punai.common.core.mapper.CommonMapper;
import com.punai.customer.domain.CusMaterialCuItem;
import com.punai.customer.domain.vo.CusLinkStaVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 材料费用项Mapper接口
 *
 * @author zxw_
 * @date 2023-01-30
 */
public interface CusMaterialCuItemMapper extends CommonMapper<CusMaterialCuItem>
{
    /**
     * 查询材料费用项
     *
     * @param id 材料费用项主键
     * @return 材料费用项
     */
    public CusMaterialCuItem selectCusMaterialCuItemById(String id);

    /**
     * 查询材料费用项列表
     *
     * @param cusMaterialCuItem 材料费用项
     * @return 材料费用项集合
     */
    public List<CusMaterialCuItem> selectCusMaterialCuItemList(CusMaterialCuItem cusMaterialCuItem);

    public List<CusMaterialCuItem> selectSimplifyList(@Param("companyId")Long companyId);


    /**
     * 删除材料费用项
     *
     * @param id 材料费用项主键
     * @return 结果
     */
    public int deleteCusMaterialCuItemById(String id);

    /**
     * 批量删除材料费用项
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCusMaterialCuItemByIds(String[] ids);

    List<CusMaterialCuItem> selectLinkDataList(@Param("linkFlag") String linkFlag, @Param("chapterId")String chapterId,
                                               @Param("companyId")Long companyId,@Param("itemName")String itemName);

    Integer selectLinkDataListCount(@Param("linkFlag") String linkFlag, @Param("chapterIds")List<String> chapterIds,
                                               @Param("companyId")Long companyId);

    List<CusLinkStaVo> selectByCusId(@Param("cusId")String cusId, @Param("companyId")Long companyId);

    List<CusMaterialCuItem> selectByCusIdSta(@Param("cusId")String cusId,@Param("companyId")Long companyId,@Param("versionId")String  versionId);

    String ifExistFee(@Param("companyId")Long companyId);
}
